home *** CD-ROM | disk | FTP | other *** search
/ World of Education / World of Education.iso / world_s / sm20a.zip / SYMBMATH.DO2 < prev    next >
Text File  |  1992-04-12  |  47KB  |  1,606 lines

  1.         SymbMath 2.0: A Symbolic Calculator with Learning
  2.                 (Version 2.0)
  3.  
  4.         Copyright (C) 1990-1992
  5.  
  6.         by Dr. Weiguang HUANG
  7.     5/6 Cara Road, Geelong, Vic. 3216, Australia
  8.         Phone: (052)443282
  9.  
  10.         This is Part Two of manual. Please read Part One in the file
  11. SymbMath.DOC.
  12.     
  13.  
  14.             15. Examples
  15.  
  16.         In following examples, a line "Input:" means to type the
  17. program in Editor, then to select the command "Run", while a
  18. line "Output:" means output in the "Output" window. # is a comment
  19. statement.
  20.  
  21.  
  22.         15.1 Assumption and Simplification
  23.  
  24.         SymbMath automatically simplifies the output expression. 
  25. Users can further simplify it by typing "last" again and again until 
  26. they are happy.
  27.     Example: reduce sqrt(x^2).
  28.         Input:
  29. sqrt(x^2)
  30.         Output:
  31. x*sgn(x)
  32.  
  33.     A first way to reduce this output expression is to substitute
  34. sgn(x) by 1 if x is positive.
  35.         Input:
  36. subs(sgn(x)=1 to last)
  37.         Output:
  38. x
  39.  
  40.     A second way to reduce the output expression is to assume
  41. x>0 before evaluation. On this way, all x is affected. The first 
  42. method is local simplification, but the second method is global
  43. simplification. If users declare the variable x is positive or 
  44. negative by 
  45.  
  46.                 assume(x > 0)
  47.                 assume(x < 0)
  48.  
  49. the output expression is more simpler than that if users do not
  50. declare it.
  51.  
  52.     Example:
  53.         Input:
  54. assume(x >0)
  55. sqrt(x^2)
  56.         Output:
  57. x
  58.  
  59.     Users can assume the variable is real by
  60.  
  61.                 assume(b == real)
  62.  
  63.     Example:
  64.         Input:
  65. assume(b == real)
  66. sqrt(b^2)
  67.         Output:
  68. abs(b)
  69.  
  70.     All variables are complex by default.
  71.     Example: set f1=x^2+y^3, then put f1 into sin(f1)+
  72. cos(2*f1).
  73.         Input:
  74. f1=x^2+y^3
  75. z=sin(f1)+cos(2*f1)
  76. z
  77.         Output:
  78. f1 = x^2 + y^3
  79. z = sin(f1) + cos (2 f1)
  80. sin(x^2 + y^3) + cos(2 (x^2 + y^3))
  81.  
  82.     Example: save the above result to f2 and display.
  83.         Input:
  84. f2=last
  85. f2
  86.         Output:
  87. sin(x^2 + y^3) + cos(2*(x^2 + y^3))
  88.  
  89. where a special word "last" stands for the last output, e.g. here
  90. "last" is sin(x^2+y^3)+cos(2*(x^2+y^3)).
  91.  
  92.  
  93.             15.2 Calculation
  94.  
  95.         SymbMath gives the exact value of calculation when the switch
  96. Numerical=Off (default), or the approximate value of calculation when 
  97. the switch Numerical=On.
  98.     SymbMath can manipulate units as well as numbers, be used as 
  99. a symbolic calculator, and do exact computation. The range of numbers 
  100. is from -infinity to infinity, e.g. ln(-inf), exp(inf+pi*i), etc. 
  101. SymbMath contains many built-in algorithms for performing numerical 
  102. calculations when the switch Numerical=On, e.g. ln(-9), i^i, 
  103. (-2.3)^(-3.2), 2^3^4^5^6^7^8^9, etc.
  104.     Warming that SymbMath only gives a principle value if there
  105. are multi-values, except for the function solve().
  106.     Example: find the exact values of sin(x) when x=pi/4 and 
  107. x=45 degree.
  108.         Input:
  109. sin(pi/4)
  110. deg=pi/180
  111. sin(45*deg)
  112.         Output:
  113. 2^(-0.5)
  114. deg = pi/180
  115. 2^(-0.5)    
  116.  
  117.     Example: set the units converter from the minute to the 
  118. second, then calculate numbers with different units.
  119.         Input:
  120. minute=60*second
  121. v=2*meter/second
  122. t=2*minute
  123. d0=10*meter
  124. v*t+d0
  125.         Output:
  126. 250 meter
  127.  
  128.  
  129.         15.3  User-defined Function and Evaluation
  130.  
  131.         Users can define a new function by 
  132.  
  133.         define(f(x)=x^2)
  134.  
  135. the right hand side of "=" includes the standard functions, calculus 
  136. functions, and algebraic operators.
  137.     Example: define a new function f(x,y)=sqrt(x^2+y^2), then 
  138. evaluate z when x=1 and y=2, and when x=3 and y=4.
  139.         Input:
  140. define(f(x,y)=sqrt(x^2+y^2))
  141. f(1,2)
  142. f(3,4)
  143.         Output:
  144. defined
  145. sqrt(5)
  146. 5
  147.  
  148.     Example: assign sqrt(x^2+y^2) to z, then evaluate z when x=1 
  149. and y=2, and when x=3 and y=4.
  150.         Input:
  151. z=sqrt(x^2+y^2)
  152. subs(x=1,y=2,z)
  153. subs(x=3,y=4,z)
  154.         Output:
  155. z = sqrt(x^2 + y^2)
  156. sqrt(5)
  157. 5
  158.  
  159.     Note that after evaluation, x and y should be cleared from 
  160. memory by clear(x) and clear(y) before differentiation of the new 
  161. function. Otherwise all of x and y still are 3 and 4 until new values 
  162. assigned. If only one variable in subs(), this variable is 
  163. automatically cleared after evaluation. This rule applies to other 
  164. functions.
  165.  
  166.  
  167.             15.4 Limits
  168.  
  169.         SymbMath finds real or complex limits, and discontinuity
  170. when x approaches to c by functions 
  171.  
  172.                 subs(x=c to f(x))
  173.                 lim(x=c, f(x))
  174.  
  175.         First use subs() to find limits, if the result is undefined
  176. (indeterminate forms, e.g. 0/0, inf/inf, 0*inf, and 0^0), then use 
  177. lim() to try again; if the result is discont, then use the one-side
  178. limit by c+zero or c-zero.
  179.  
  180.     Example: find limits of types 0/0 and inf/inf.
  181.         Input:
  182. p=(x^2-4)/(2*x-4)
  183. subs(x=2 to p)
  184. lim(x=2, p)
  185. subs(x=inf to p)
  186. lim(x=inf, p)
  187.         Output:
  188. p = (x^2 - 4)/(2 x - 4)
  189. undefined
  190. 2
  191. undefined
  192. inf
  193.  
  194.         The "discont" (discontinuity) means that the expression has
  195. a discontinuity and only has the one-sided limit value at x=c. Users 
  196. should use c+zero or c-zero to find one-sided limit. The f(c+zero) or 
  197. f(c-zero) is the right-sided limit or left-sided limit as approaching 
  198. c from positive (+inf) or negative (-inf) direction, respectively, 
  199. i.e. limit as zero -> 0.
  200.         SymbMath find left-sided limit or right-sided limit when x 
  201. approaches to c from positive (+inf) or negative (-inf) direction at 
  202. discontinuity by functions
  203.  
  204.                 subs(x=c+zero to f(x))
  205.                 subs(x=c-zero to f(x))
  206.                 lim(x=c+zero, f(x))
  207.                 lim(x=c-zero, f(x))
  208.  
  209.         Example: find left-sided and right-sided limits of y=exp(1/x),
  210. (i.e. when x approaches 0 from positive and negative directions).
  211.         Input:
  212. y=exp(1/x)
  213. subs(x=0 to y)
  214. subs(x=0+zero to y)
  215. subs(x=0-zero to y)
  216.         Output:
  217. y = exp(1/x)
  218. discont
  219. inf
  220. 0
  221.  
  222.         The built-in constants of inf or -inf, zero or -zero, and 
  223. discont or undefined can be used as numbers in calculation of 
  224. expressions or functions.
  225.  
  226.         input:
  227. 1/sgn(0)
  228. 1/sgn(zero)
  229.         output:
  230. discont
  231. 1
  232.  
  233.  
  234.                         15.5 Differentiation
  235.  
  236.     SymbMath differentiates an expression expr by functions 
  237.  
  238.         d(expr / d(x))
  239.         d(expr / d(x), order)
  240.         d(expr, x=c)
  241.         d(expr, x=c, order)
  242.  
  243.     Example: differentiate the expression f=sin(x^2+y^3)+
  244. cos(2*(x^2+y^3)) with respect to x, and with respect to both x and y.
  245.         Input:
  246. f=sin(x^2+y^3)+cos(2*(x^2+y^3))
  247. d(f /d(x))
  248. d(d(f/d(x))/d(y))
  249.         Output:
  250. f = sin(x^2 + y^3) + cos(2*(x^2 + y^3))
  251. 2*x*cos(x^2 + y^3) - 4*x*sin(2*(x^2 + y^3))
  252. -6*x*y^2*sin(x^2 + y^3) - 12*x*y^2*cos(2*(x^2 + y^3))
  253.  
  254.  
  255.             15.6 Integration
  256.  
  257.         SymbMath finds integrals by functions 
  258.  
  259.         inte(expr * d(x)) 
  260.         inte(expr, variable from a to b)
  261.  
  262.     The library Integral.Li should be read from a disk before formal
  263. integration so that it become more powerful on integration. It is better 
  264. to expand the integrand by the function expand() before formal 
  265. integration. 
  266.     If formal integration fails, numerical integration is used 
  267. when users set the switch NumIntegate=On.
  268.  
  269.  
  270.         15.6.1 Indefinite Integration
  271.  
  272.         Example: find indefinite integrals.
  273.         Input:
  274. inte(sinh(x)^2*e^sinh(x)*cosh(x)*d(x))
  275.         Output:
  276. constant - 2 (-exp(sinh(x)) + sinh(x)*exp(sinh(x))) + sinh(x)^2*exp(sinh(x))
  277.  
  278.         Input:
  279. inte(sinh(x)^2*cosh(x)*d(x))
  280.         Output:
  281. constant + (1/3)*sinh(x)^3
  282.  
  283.     Example: find indefinite double integrals.
  284.         Input:
  285. inte(inte(x*y*d(x))*d(y))
  286.         Output:
  287. constant + Constant*y + (1/4)*x^2*y^2
  288.  
  289.     Example: find the line integral.
  290.         Input:
  291. x=2*t
  292. y=3*t
  293. z=5*t
  294. u=x+y
  295. v=x-y
  296. w=x+y+z
  297. inte((u*d(u/d(t))+v*d(v/d(t))+w*d(w/d(t)) * d(t))
  298.         Output:
  299. 63*t^2
  300.  
  301.     Example: find the integral of ln(x)^6/x by the mean of the
  302. library Integral.Li. First run Integral.Li, then
  303.     Input:
  304. inte(ln(x)^n/x*d(x))
  305. subs(n=6, last)
  306.     Output:
  307. ln(x)^(1+n)/(1+n)
  308. (1/7)*ln(x)^7    
  309.  
  310.  
  311.         15.6.2 Definite Integration
  312.  
  313.         Example: find the definite integral of y=exp(1-x) with 
  314. respect to x taken from x=0 to x=infinity.
  315.         Input:
  316. inte(exp(1-x), x from 0 to inf)
  317.         Output:
  318. e
  319.  
  320.     Example: compare numerical integration and symbolic 
  321. integration for y=4/(1+x^2) with respect to x taken from x=0 to x=1.
  322.         Input:
  323. NumIntegrate=On
  324. y=4/(1+x^2)
  325. inte(y, x from 0 to 1)
  326.         Output:
  327. 3.1415
  328.  
  329.         Input:
  330. NumIntegrate=Off
  331. y=4/(1+x^2)
  332. inte(y, x from 0 to 1)
  333.         Output:
  334. pi
  335.  
  336.         Input:
  337. Numerical=On
  338. pi
  339.         Output:
  340. 3.1416
  341.  
  342.  
  343.     Example: discontinuous integration of 1/x and 1/x^2 with
  344. discontinuity at x=0.
  345.         Input:
  346. inte(1/x, x from -1 to 2)
  347.         Output:
  348. ln(2)
  349.  
  350.         Input:
  351. inte(1/x^2, x from -1 to 0-zero) + inte(1/x^2, x from 0+zero to 2)
  352.         Output:
  353. inf
  354.  
  355.  
  356.             15.7 Algebraic Equations
  357.  
  358.         The equations can be operated (e.g. +, -, *, /, ^, expand(), 
  359. diff(), inte()). The operation is on both sides of the equation, as 
  360. by hand. SymbMath is able to find roots of a polynomial, algebraic 
  361. equations, systems of equations, differential and integral equations.
  362.     Example: solve an equation 
  363. sqrt(x+2*k) - sqrt(x-k) == sqrt(k), 
  364. then check the solution by substituting the root into the equation.
  365.         Input:
  366. eq1=(sqrt(x + 2*k) - sqrt(x - k) == sqrt(k))
  367. eq1^2
  368. expand(last)
  369. last-k-2*x
  370. last/(-2)
  371. last
  372. last^2
  373. expand(last)
  374. last-x^2+2*k
  375. last/k
  376. subs(x=right(last) to eq1)
  377.         Output:
  378. eq1=(sqrt(x + 2*k) - sqrt(x - k) == sqrt(k))
  379. ((2*k + x)^0.5 - ((-k) + x)^0.5)^2 == k
  380. 2*x + k + (-2)*(2*k + x)^0.5*((-k) + x)^0.5 == k
  381. (-2)*(2*k + x)^0.5*((-k) + x)^0.5 == (-2)*x
  382. (1/1)*(2*k + x)^0.5*((-k) + x)^0.5 == (1/1)*x
  383. (2*k + x)^0.5*((-k) + x)^0.5 == x
  384. (2*k + x)*((-k) + x) == x^2
  385. (-2)*k^2 + k*x + x^2 == x^2
  386. k*x == 2*k^2
  387. x == 2*k
  388. k^0.5 == k^0.5
  389.  
  390.         SymbMath can solve many algebraic equations step by step, as 
  391. by hand. This method is useful on teaching, e.g. to show students how 
  392. to solve equations.
  393.     SymbMath has the built-in function 
  394.  
  395.                 solve(expr1 == expr2, x)
  396.         solve([expr1 == expr2, expr3 == expr4], [x, y])
  397.  
  398. to solve a polynomial and systems of linear equations on one step.
  399. All of the real and complex roots of the equation will be found.
  400. The function solve() outputs a list of roots when there are multi-
  401. roots. Users can get one of roots from the list, (see the later 
  402. chapter "List and Array").
  403.     Users can get one side of the equation by the functions 
  404.  
  405.                 left(left_side==right_side)
  406.  
  407. for the left side, and
  408.  
  409.                 right(left_side==right_side)
  410.  
  411. for the right side.
  412.  
  413.     Example: solve a+b*x+x^2 == 0, save the root to x, find the 
  414. value of x when a=3 and b=4.
  415.         Input:
  416. eq1=(a+b*x+x^2==0)
  417. solve(eq1, x)
  418. right(last)
  419. x=last
  420. a=3, b=4
  421. x[1]
  422. x[2]
  423.         Output:
  424. eq1=(a+b*x+x^2==0)
  425. x == [-b/2 + sqrt((b/2)^2 - a),  -b/2 - sqrt((b/2)^2 - a)]
  426. [-b/2 + sqrt((b/2)^2 - a),  -b/2 - sqrt((b/2)^2 - a)]
  427. x=
  428. a=3, b=4
  429. -1
  430. -3
  431.  
  432.     Note that after assignment of 3 to the variable "a" by "=", 
  433. the variable "a" still is 3 in all expressions until new value 
  434. assigned, and cannot be automatically cleared from memory. This is 
  435. different from subs().
  436.     Function solve() not only solve for a simple variable x
  437. but also for an unknown function, e.g. ln(x).
  438.         Input:
  439. solve(1+ln(x)+ln(x)^2==0, ln(x))
  440. exp(last)
  441.         Output:
  442. ln(x) ==
  443. x ==
  444.  
  445.         Input:
  446. f=[x+y==3+a+b, x-y==1+a-b], [x,y])
  447. solve(f, [x,y])
  448. solve(f, [a,b])
  449. solve(f, [a,y])
  450. solve(f, [x,b])
  451.         Output:
  452. f = [x + y == 3 + a + b, x - y == 1 + a - b]
  453.  
  454. [x == -(1/2)*(-4 - 2 a), y == -(1/2)*(-2 - 2 b)]
  455.  
  456. [a == -(1/2)*(4 - 2 x), b == -(1/2)*(2 - 2 y)]
  457.  
  458. [b == -(1/2)*(2 - 2 y), x == -(1/2)*(-4 - 2 a)]
  459.  
  460. [a == (1/2)*(-4 + 2 x), y == (1/2)*(2 + 2 b)]
  461.  
  462.  
  463.  
  464.                 15.8 Differential and Integral Equations 
  465.  
  466.         SymbMath can solve separable differential equations 
  467.  
  468.                 f(x)*d(x)+g(y)*d(y) == f2(x)*d(x)+g2(y)*d(y),
  469.                 g(y)*d(d(y)/d(x))/d(x) == f(x), etc.
  470.  
  471. where f(x) and f2(x) are the functions of x only, and g(y) and g2(y) 
  472. are the functions of y only. d(y)/d(x) is used as y', and d(y) and d(x) 
  473. can be separated in differential equations. d(d(y)/d(x))/d(x) is used 
  474. as y".
  475.     Example: solve 5*x^4 + y*d(y)/d(x)==0 where y=f(x).
  476.         Input:
  477. 5*x^4 + y*d(y)/d(x)==0
  478. last*d(x)
  479. inte(last)
  480. last-x^5
  481. last*2
  482. sqrt(last)
  483.         Output:
  484. 5*x^4 + y*d(y)/d(x)==0
  485. 5*x^4*d(x) + y*d(y) == 0
  486. x^5  + (1/2)*y^2 == Constant
  487. (1/2)*y^2 == Constant - x^5
  488. y^2 == 2*(Constant - x^5)
  489. y == sqrt(2*(Constant - x^5))
  490.  
  491.     For example: solve a second order differential equation 
  492. y*y'' == exp(x).
  493.         Input:
  494. y*d(d(y)/d(x))/d(x) == exp(x)
  495. inte(last*d(x))
  496. inte(last*d(x))
  497. last*6
  498. last^(1/3)
  499.         Output:
  500. y*d(d(y)/d(x))/d(x) == exp(x)
  501. (1/2)*y^2 *d(y)/d(x) == Constant + exp(x)
  502. (1/6)*y^3 == Constant + Constant*x + exp(x)
  503. y^3  == 6*Constant + 6*Constant*x + 6*exp(x)
  504. y == (6*Constant + 6*Constant*x + 6*exp(x))^(1/3)
  505.  
  506.     The function 
  507.  
  508.         solve(d(y)/d(x)+g(x)*y == h(x), y) 
  509.  
  510. can solve first order linear differential equation d(y)/d(x)+g(x)*y==h(x) 
  511. on one step.
  512.         Input:
  513. solve(d(y)/d(x)+sinh(x)*y == sinh(x)*cosh(x), y)
  514.         Output:
  515. y == (constant + exp(cosh(x)) - cosh(x)*exp(cosh(x)))*exp(-cosh(x))
  516.  
  517.  
  518.                   15.9 Sums and Products
  519.  
  520.         Users can compute partial, finite or infinite sums and 
  521. products. Sums and products can be differentiated and integrated. You 
  522. construct functions like Taylor polynomials or finite Fourier series.  
  523. The procedure is the same for sums as products so all examples will
  524. be restricted to sums.  The general formats for these functions are:
  525.  
  526.                 sum(expr, x from a to b step c)
  527.                 prod(expr, x from a to b step c)
  528.  
  529. The expression expr is evaluated at a, a+c, ...  up to the last
  530. entry in the series not greater than c, and the resulting values
  531. are added or multiplied.  The part "step c" is optional and
  532. defaults to 1.  The values of a, b and c can be any real number.
  533.  
  534. Here are some examples:
  535.          sum(j, j from 1 to 10)   
  536. for 1 + 2 + .. + 10.
  537.           sum(3^j, j from 0 to 10 step 2)  
  538. for 1 + 3^2 + ... + 3^10.
  539.           Here are some sample Taylor polynomials:
  540.     sum(x^j/j!, j from 0 to n)  
  541. for exp(x).
  542.     sum((-1)^j*x^(2*j+1)/(2*j+1)!, j from 0 to n)
  543. for sin(x) of degree 2*n+2.
  544.  
  545.     The library file SUM.LI should be read before computing 
  546. partial and infinite sums, and the library file PRODUCT.LI should be 
  547. read before computing partial and infinite products.
  548.     Remember, the keywords "from", "to" and "step" can be 
  549. replaced by commas.
  550.  
  551.  
  552.         15.10     Series
  553.  
  554.     Example: find the power series expansion for cos(x) about
  555. the point x=0 to order x^4.
  556.         Input:
  557. sum(d(cos(x), x=0, n)*x^n/n!, n from 0 to 4)
  558.         Output:
  559. 1 - (1/2)*x^2 + (1/24)*x^4
  560.  
  561.         Define the TAYLOR function for Taylor series at x=0, then call
  562. TAYLOR().
  563.         Input:
  564. define(TAYLOR(y, n)=sum(d(y, x=0, k)*x^k/k!, k from 0 to n))
  565. TAYLOR(cos(x), 4)
  566.         Output:
  567. defined
  568. 1 - (1/2)*x^2 + (1/24)*x^4
  569.  
  570.  
  571.                 15.11 Lists, Arrays, Vectors and Matrices
  572.  
  573.         SymbMath can construct lists of arbitrary length, and the 
  574. entries in the lists can be of any type of value whatsoever: 
  575. constants, expressions with undefined variables, or even other lists.  
  576. Lists are another kind of value in SymbMath, and they can be assigned 
  577. to variables just like simple values.  (Since variables in SymbMath 
  578. language are untyped, you can assign any value to any variable.).
  579.  
  580.  
  581.               15.11.1     Entering Lists
  582.  
  583.         To define a list, put its elements between square brackets:
  584.  
  585.              a = [1,2,3]
  586.              b = [f(2), g(1), h(1)]      # assumes f,g,h defined
  587.              c = [[1,2],3,[4,5]]
  588.  
  589.     A function can have a list for its value:
  590.              f(x) = [1,x,x^2]
  591.         You can define lists another way, with the list command:
  592.  
  593.                  list(f(t), t from a to b step c)
  594.  
  595.         This is similar to the sum command,  but the result is a list:
  596.                        [f(a), f(a+c), ..., f(a+j*c), ...]
  597. which continues until the last value of a + j*c  <= b .  
  598.     Try
  599.  
  600.              a = list(j^2, j from 0 to 10 step 1)
  601.              f(x) = list(x^j, j from 0 to 6 step 1)
  602.              b = f(-2)
  603.  
  604.           The third way to construct a list is to transform the sum to
  605. the list.
  606.         Input:
  607. y1=[a,b,c]
  608. sum(y1)+d
  609. list(last)
  610.         Output:
  611. y1 = [a, b, c]
  612. a + b + c + d
  613. [a, b, c, d]
  614.  
  615.           This is how you extend an existing list to include a new 
  616. element.
  617.  
  618.  
  619.               15.11.2     Accessing Lists
  620.  
  621.         To find the value of the j-th element in a list x, use the
  622. formula  x[j]. The first element of x is always  x[1].  If the x[j] 
  623. is itself a list, then its k-th element is accessed by repeating the 
  624. similar step. Try:
  625.         Input:
  626. x = [[1,2],3,[4,5]]
  627. x[1]
  628. x[2]
  629.         Output:
  630. x = [[1, 2], 3, [4, 5]]
  631. [1, 2]  
  632. 3
  633.  
  634.         An entire sub-list of a list x  can be accessed with the 
  635. command x[j], which is the list:
  636.                   [x[j], x[j+1], ... ]
  637.  
  638.  
  639.               15.11.3     Modifying Lists
  640.  
  641.         The function subs() substitutes the value of the element in
  642. the list, as in the variables. e.g.
  643.  
  644.         Input:
  645. l=[a,b,c]
  646. subs(a=a2 to l)
  647.         Output:
  648. l = [a, b, c]
  649. [a2, b, c]
  650.  
  651.     But you can't use this form unless the element of the list is
  652. already defined.
  653.  
  654.  
  655.               15.11.4     List Operations
  656.  
  657.         Lists can be added, subtracted, multiplied, and divided by 
  658. other lists or by constants.  When two lists are combined, they are
  659. combined term-by-term, and the combination stops when the shortest 
  660. list is exhausted.  When a scalar is combined with a list, it is 
  661. combined with each element of the list.  Try:
  662.  
  663.          a = [1,2,3]
  664.          b = [4,5,6]
  665.          a + b
  666.          a / b
  667.          3 * a
  668.          b - 4
  669.  
  670.     Example:
  671.         Input:
  672. list1=[a1,a2,a3]
  673. list2=[b1,b2,b3]
  674. list1+list2
  675. last[1]
  676.         Output:
  677. list1 = [a1,a2,a3]
  678. list2 = [b1,b2,b3]
  679. [a1 + b1, a2 + b2, a3 + b3]
  680. a1 + b1
  681.  
  682.     If L is a list, then  f(L) results in a list of the values  
  683. f(L[i]), even though f() is differentiation d() or integration inte().  
  684. Try series  with:
  685.     Input:
  686. sqrt([a, b, c])
  687. d([x, x^2, x^3]/d(x))
  688.  
  689.     You can sum all the elements in a list x with the commands:
  690.  
  691.                        sum(x)
  692.  
  693.     If you use a list as the value of a variable in a user-
  694. defined function, SymbMath will try to use the list in the 
  695. calculation.  
  696.     Example:
  697.  
  698.             x=[1,2,3]
  699.                         sum(x^2)
  700.  
  701.     This functions takes the sum of the squares of the elements of
  702. the list x.
  703.  
  704.  
  705.               15.11.5     Vector Operations
  706.  
  707.         Vectors and matrices can be operated by "+" and "-" with vectors
  708. and matrixes, by "*" and "/" with a scalar, and by subs(), diff() and 
  709. inte(). These operations are on each element, as in lists and arrays.
  710.     You can use lists as vectors, adding them and multiplying them 
  711. by scalars. For example, the dot product of two vectors of a and b is:
  712.  
  713.                        dot = sum(a*b)
  714.  
  715.     You can even make this into a function:
  716.  
  717.                        Dot(x,y) = sum(x*y)
  718.                        a = [2,3,5]
  719.                        b = [4,3,2]
  720.                        Dot(a,b)
  721.  
  722.     How about the cross product:
  723.  
  724. Cross(a,b) = [a[2]*b[3]-b[2]*a[3],a[3]*b[1]-b[3]*a[1],a[1]*b[2]-b[1]*a[2]]
  725.  
  726.          
  727.         15.12     Complex Analysis
  728.  
  729.         The complex numbers, complex infinity and some complex 
  730. functions can be calculated, and the complex expressions can be 
  731. differentiated and integrated.
  732.     Sign of complex numbers is defined as
  733.  
  734.          /  1 (i.e. z>0 )     if re(z)>0, or re(z)=0 and im(z)>0,
  735. sgn(z) =    0             if z=0,
  736.          \ -1 (i.e. z<0 )     otherwise.
  737.  
  738.     Example:
  739.         Input:
  740. sgn(1+i)
  741. sgn(1-i)
  742. sgn(-1-i)
  743.         Output:
  744. 1
  745. 1
  746. -1
  747.  
  748.         Input:
  749. exp(inf+pi*i)
  750. ln(last)
  751.         Output:
  752. -inf
  753. inf + pi*i
  754.  
  755.     Input:
  756. inte(1/x, x from i to 2*i)
  757.     Output:
  758. ln(2)
  759.  
  760.         15.13     Tables of Function Values
  761.  
  762.         If you want to look at a table of values for a formula, you 
  763. can use the table command:
  764.  
  765.           table(f(x), x from a to b step dx)
  766.  
  767. It causes a table of values for f(x) to be displayed with x=a, 
  768. a+dx, ..., b.  You can specify a function to be in table(), 
  769.     Example: 
  770.         Input:
  771. table(x^2, x from 0 to 10 step 1)
  772.         Output:
  773. 0,      0
  774. 1,      1
  775. 2,      4
  776. :       :
  777. :       :
  778.  
  779.     Its output can be written into a disk file for interface
  780. with other software (e.g. the numeric computation software).
  781.  
  782.  
  783.         15.14 Transformation and Piece of Expressions
  784.  
  785.         Different types of data may be transformed each other.
  786.     The complex number z is transformed to the real number x by
  787.  
  788.         re(z), im(z), abs(z), sgn(z).
  789.  
  790.     The functions
  791.  
  792.             left() and right()
  793.  
  794. pick up one side of the equation.
  795.     A list is transformed to a sum by
  796.  
  797.         sum(List_Expr)
  798.  
  799. A sum is transformed to a list by
  800.  
  801.         list(Sum_Expr)
  802.  
  803.     e.g.
  804.         Input:
  805. [a, b*x, c*x^2]
  806. sum(last)
  807. list(last)
  808.         Output:
  809. [a, b*x, c*x^2]
  810. a + b*x + c*x^2
  811. [a, b*x, c*x^2]
  812.  
  813.         A list can be transformed to a table with the table command if 
  814. the elements of the list are the numbers. e.g.
  815.         Input:
  816. x=[5,4,3,2,1]
  817. table(x[j], j from 1 to 4 step 1)
  818.         Output:
  819. 1,      5
  820. 2,      4
  821. 3,      3
  822. 4,      2
  823.  
  824.     A piece of an expression can be picked up. e.g.
  825.         Input:
  826. y=a+b*x+c*x^2+d*x^3
  827. coef(y, x)
  828. coef(y, x^2)*x^2
  829. list(y)
  830. last[3]
  831.         Output:
  832. y = a + b*x + c*x^2 + d*x^3
  833. b
  834. c*x^2
  835. [a, b*x, c*x^2, d*x^3]
  836. c*x^2
  837.  
  838.  
  839.     Table 15.2    Expand and Factor
  840. ---------------------------------------------------------------------
  841. Expand            Factor
  842.  
  843. (a+b)^2            a^2+2*a*b+b^2
  844. (a+b)^n            a^n+ ...... +b^n    n is positive integer
  845. a*(b+c)            a*b + a*c
  846. ---------------------------------------------------------------------
  847.     a+b can be many terms or a-b.
  848.  
  849.  
  850.         15.15 Chemical Calculation
  851.  
  852.         SymbMath recognizes 100 symbols of chemical elements and 
  853. converts them into their atomic weights after the chemical library
  854. "Chemical.Li" is run.
  855.     Example: calculate the weight percentage of the element C 
  856. in the molecule CH4.
  857.         Run the library file "Chemical.Li", then
  858.         Input:
  859. Numerical=On
  860. C/(C+H*4)*100*%
  861.         Output:
  862. 74.868 %
  863.  
  864.     Example: calculate the molar concentration of CuO when 3 
  865. gram of CuO is in 0.5 litre of a solution.
  866.         Input:
  867. Numerical=On
  868. g=1/(Cu+O)*mol
  869. 3*g/(0.5*l)
  870.         Output:
  871. 0.07543 mol/l
  872.  
  873.             15.16 Chemical Reactions
  874.  
  875.         SymbMath can provide the answers for inorganic chemical 
  876. reactions after the inorganic reaction library "Inorgani.Li" is run,
  877. and for organic chemical reactions after the organic reaction library
  878. "Organic.Li" is run.
  879.     Example: what are the products when the reactors are HCl + 
  880. NaOH ?
  881.         Run the library file "Inorgani.Li", then
  882.         Input:
  883. HCl+NaOH
  884.         Output:
  885. H2O + NaCl
  886.  
  887.  
  888.                     15.17 Learning from Users
  889.  
  890.         The most important feature of SymbMath is that SymbMath can
  891. learn from users to deduce and expand its knowledge. If users provide
  892. the necessary facts, then SymbMath can solve many problems it could 
  893. not do before.
  894.  
  895.  
  896.         15.17.1 Learning complicated indefinite integrals from a
  897.                 simple indefinite integral
  898.  
  899.         Users supply a simple indefinite integral, and then ask many
  900. complicated indefinite integrals.
  901.         Example. Users show that an indefinite integral
  902. of tan(x)^2 is tan(x)-x, then ask indefinite integral of
  903. 2*tan(x)^2+x, and a double indefinite integral of tan(x)^2+y respect
  904. with both x and y.
  905.  
  906.         Input:
  907. inte(tan(x)^2*d(x))
  908. inte((2*tan(x)^2+x)*d(x))
  909. inte(inte(tan(x)^2+y)*d(x))*d(y))
  910.     Output:
  911. inte(tan(x)^2*d(x))
  912. inte((2*tan(x)^2+x)*d(x))
  913. inte(inte(tan(x)^2+y)*d(x))*d(y))
  914.  
  915. The input are to check whether SymbMath had already known these
  916. integrals or not (i.e. to check if these integrals had already been
  917. stored in the data base or knowledge base, these checking would be
  918. omitted if users trust SymbMath without these predefined knowledge).
  919. On this time, only change the first line, and then run again.
  920.  
  921.         Input:
  922. inte(tan(x)^2*d(x)) = tan(x) - x
  923. inte((2*tan(x)^2+x)*d(x))
  924. inte(inte(tan(x)^2+y)*d(x))*d(y))
  925.  
  926. The first input line is to teach SymbMath the indefinite integral of
  927. tan(x)^2. The second and third input lines are to ask the indefinite
  928. integral of 2*tan(x)^2+x and the double indefinite integral of
  929. tan(x)^2+y.
  930.  
  931.         Output:
  932. inte(tan(x)^2*d(x)) = tan(x) - x
  933. 2 (tan(x) - x) + (1/2)*x^2
  934. tan(x)*y - x*y + x*y^2
  935.  
  936. Users will ask inte(inte(tan(x)^2+y^2)*d(x))*d(y)),
  937. inte(inte(tan(x)^2*y)*d(x))*d(y)), inte(x*tan(x)^2*d(x)),
  938. triple integral of tan(x)^2-y+z, or others.
  939.  
  940.  
  941.         15.17.2 Learning definite integral from indefinite integral
  942.  
  943.         Users continue to ask definite integrals as well.
  944.  
  945.         Input:
  946. inte(inte(tan(x)^2+y, x from 0 to 1), y from 0 to 2)
  947.         Output:
  948. 2 tan(1)
  949.  
  950.         Why does SymbMath become to have these knowledge ? Because
  951. SymbMath logically deduces these integrals from inte(tan(x)^2*d(x)).
  952. This is learning from users.
  953.         Notice that SymbMath has not had knowledge of all of these
  954. integrals before. Users did nothing, except for only telling SymbMath
  955. one simple indefinite integral of tan(x)^2, did not tell SymbMath
  956. anything about other indefinite integral (e.g. tan(x)^2+y, tan(x)^2+x,
  957. etc.), an indefinite double integral, definite integral, or definite
  958. double integral, did not write any code (a function, procedure or 
  959. subroutine), did not load any file, did not call any subroutine. 
  960.  
  961.  
  962.                 15.17.3 Learning complicated derivative from simple
  963.                         derivative
  964.  
  965.         Input:
  966. d(Ci(x)/d(x))
  967. d((Ci(x)^6)/d(x))
  968.     Output:
  969. d(Ci(x)/d(x))
  970. d((Ci(x)^6)/d(x))
  971.  
  972. Now, only change the first line, and then run again.
  973.     Input:
  974. d(Ci(x)/d(x))=cos(x)/x
  975. d((Ci(x)^6)/d(x))
  976.         Output:
  977. d(Ci(x)/d(x)) = cos(x)/x
  978. 6 Ci(x)^5*cos(x)/x
  979.  
  980.  
  981.                 15.17.4 Learning integration from derivative
  982.  
  983.         If users input derivatives, SymbMath can deduce integrals from
  984. derivatives. e.g. users enter d(Si(x)/d(x))=sin(x)/x, d(Ci(x)/d(x))=
  985. cos(x), then ask the integral of sin(x)/x^3.
  986.  
  987.         Input:
  988. d(Si(x)/d(x))=sin(x)/x
  989. d(Ci(x)/d(x))=cos(x)/x
  990. inte(sin(x)/x^3*d(x))
  991.         output:
  992. d(Si(x)/d(x)) = sin(x)/x
  993. d(Ci(x)/d(x)) = cos(x)/x
  994.  
  995.  
  996.     SymbMath have learned to solve these problems, even although 
  997. the problems are different.
  998.  
  999.  
  1000.                 15.17.5 Learning integration from algebra
  1001.  
  1002.         If users tell SymbMath algebra, SymbMath can learn integrals
  1003. from algebra. e.g. users show sin(x)^2=1/2-1/2*cos(2*x), then ask
  1004. integral of sin(x)^2.
  1005.  
  1006.         Input:
  1007. sin(x)^2=1/2-1/2*cos(2*x)
  1008. inte(sin(x)^2*d(x))
  1009.         Output:
  1010. sin(x)^2 = 1/2-1/2*cos(2*x)
  1011. (1/2)*x - (1/4)*sin(2*x)
  1012.  
  1013.  
  1014.                 15.17.6 Learning complicated algebra from
  1015.                         simple algebra
  1016.  
  1017.         Input:
  1018. sin(x)/cos(x)=tan(x)
  1019. x+sin(x)/cos(x)
  1020.         Output:
  1021. sin(x)/cos(x) = tan(x)
  1022. x + tan(x)
  1023.  
  1024.  
  1025.         Learning is different from programming. On learning, although
  1026. users only input one formula, SymbMath will learn many knowledge.
  1027. SymbMath is able to learn, as a student does. On programming, users 
  1028. have many things to do. First, users define many subroutines for the
  1029. individual integrands (e.g. tan(x)^2, tan(x)^2+y^2, 2*tan(x)^2+x, 
  1030. x*tan(x)^2, etc.), and for individual integrals (e.g. the indefinite 
  1031. integral, definite integral, the indefinite double integrals, 
  1032. indefinite triple integrals, definite double integrals, definite 
  1033. triple integrals, etc.), second, write many lines of program for the
  1034. individual subroutines, (i.e. to tell the computer how to calculate
  1035. these integrals), third, load these subroutines, finally, call these
  1036. subroutines.
  1037.         On other word, programming means that programmers must
  1038. provide step-by-step procedures telling the computer how to solve
  1039. each problems. By contrast, learning means that users need only supply
  1040. the necessary facts, SymbMath will determine how to go about
  1041. solutions.
  1042.         The learning can be saved into a disk as a disk file, so that
  1043. SymbMath will never forget it, otherwise SymbMath will forget the
  1044. learning when the computer power is off.
  1045.  
  1046.  
  1047.                 16. Interface with Other Software
  1048.  
  1049.         SymbMath can be interfaced with other software, (e.g. the 
  1050. numerical calculation, data analysis, graph, and plot software, etc.). 
  1051.  
  1052.                 16.1 With PlotData for Graph
  1053.  
  1054.         If SymbMath is interfaced with the software PlotData, SymbMath 
  1055. produces the data table of functions, and PlotData plots from the 
  1056. table, as SymbMath seems to do graphics. This interface can be used
  1057. to solve equations graphically.
  1058.     e.g. plot f(x)=2*x^2 in the range of x from 0 to 40 by 
  1059. following steps:
  1060.     1) Write a line of program with table() in the Editor:
  1061.                 table(2*x^2, x from 0 to 40 step 1)
  1062.         2) Select the command "To disk" in the "Output" menu to force 
  1063. output to the disk file.
  1064.     3) Run the program.
  1065.     4) Select the command "Off disk" in the "output" menu to 
  1066. return control to the window.
  1067.         5) Select the command "OS shell" in the "File" menu, then type
  1068. PlotData in the input window.
  1069.  
  1070. in the software PlotData, just read and plot. PlotData read the data
  1071. in the SymbMath format without any modification (and in many data 
  1072. format). Refer to PlotData for detail.
  1073.  
  1074.  
  1075.             17. Inside SymbMath
  1076.  
  1077.         As an expert system, SymbMath consists of three major 
  1078. components: a knowledge base, an inference engine, and a global data 
  1079. base. The knowledge base is a set of rules, the inference engine is a 
  1080. rule interpreter for utilizing the knowledge base in the solution of 
  1081. the problem, and the global data base is a working memory for keeping 
  1082. track of the problem status, the data from the data file for the 
  1083. particular problem, and the solution of sub-problems. In addition, it 
  1084. contains a natural language interface for input and output natural 
  1085. languages (e.g. mathematical formulas, chemical reactions).
  1086.  
  1087.  
  1088.         User    Library        disk
  1089.          /|\       |         /|\
  1090.           |       |          |
  1091.          \|/      \|/         \|/
  1092.         ------------------------------
  1093.         | Natural Language Interface |
  1094.         ------------------------------
  1095.                    /|\
  1096.                 |
  1097.                    \|/
  1098.         ------------------------------
  1099.     ------->|     Inference Engine    |<----------
  1100.     |    ------------------------------        |
  1101.        \|/                           \|/
  1102. ------------------                --------------------
  1103. | Knowledge Base |                | Global Data Base |
  1104. ------------------                --------------------
  1105.                                /|\
  1106.                             |
  1107.                         --------------------
  1108.                         |    Data File     |
  1109.                         --------------------
  1110.  
  1111.     Figure 17.1     Base structure of SymbMath
  1112.  
  1113.  
  1114.  
  1115.     Table 17.1    Characteristics of SymbMath
  1116. --------------------------------------------------------------------
  1117. Function:            Symbolic computation.
  1118. Domain:                Mathematics, chemistry.
  1119. Search direction:        Forward chaining.
  1120. Control mechanism:        Guessing and test, pattern match.
  1121. Search space transformations:      Break into sub-problems.
  1122. Knowledge base representation:    Rules.
  1123. Developer interface:        Library, programming.
  1124. End user interface:             Pull-down menu, pop-up menu, twin screen
  1125.                                 text editor, help.
  1126. System interface:        numeric computation software, graphic 
  1127.                 software (e.g. PlotData), etc.
  1128. Input format:            Math formulas, numbers, Q-BASIC or FORTRAN 
  1129.                 codes, chemical symbols and reactions.
  1130. Output format:                  Math notation, Q-BASIC, FORTRAN, chemical 
  1131.                 reactions.
  1132. Input from:            Keyboard, disk.
  1133. Output to:            Screen, disk, printer.
  1134. Tool language:            Prolog.
  1135. Computer:            IBM PC.
  1136. Memory:                640 KBytes.
  1137. Operating system:        MS-DOS.
  1138. ---------------------------------------------------------------------
  1139.  
  1140.  
  1141.             18. System limits
  1142.  
  1143.         1. The maximum character of a symbol is 127.
  1144.     2. The maximum character of an output expression is 64,000.
  1145.     3. The range of the input real numbers is 
  1146. -inf, -(10^307)^(10^307) to -(10^-307)^(10^-307), 0, (10^-307)^(10^-307)
  1147.  to (10^307)^(10^307), inf.
  1148.     4. The range of the output real numbers is the same as input 
  1149. when the switch Numerical=Off, but when the switch Numerical=On, it is
  1150.     -inf, -1.E307 to -1.E-307, 0, 1.E-307 to 1.E307, inf.
  1151.     5. The maximum digit of the input numbers is 127.
  1152.     6. The maximum digit of the stored numbers is 16.
  1153.     7. The maximum digit of the output numbers is 11.
  1154.  
  1155.  
  1156.             19. Future
  1157.  
  1158.         In the later version, SymbMath will do
  1159. 1. More functions.
  1160. 2. Precision calculation: the maximum digit of the output number is 
  1161.     64000.
  1162. 3. Solving differential equations by Laplace transform.
  1163.  
  1164.  
  1165.             20.     Keywords
  1166.  
  1167.         SymbMath has three versions. Shareware and Student Versions
  1168. are lack some functions, (see the document file SymbMath.DOC for 
  1169. detail). The following special symbols (about 110 words) are reserved:
  1170.  
  1171.             20.1   A list of keywords in alphabetical order
  1172.  
  1173. ----------------------------------------------------------------------
  1174. abs, acos, acosh, acot, acoth, acsc, acsch, asec, asech, asin,
  1175. asinh, assume, assumed, atan, atanh,
  1176. BASIC,
  1177. clear, clear_all, cleared, coef, complex, constant, cos, cosh, cot,
  1178. coth, csc, csch,
  1179. d, define, defined, deno, discont, done,
  1180. E, e, end, erf, exp, expand, ExpExpand,
  1181. fac, factor, FORTRAN, from,
  1182. i, im, inf, inte,
  1183. last, left, lim, list, ln, LnExpand,
  1184. nume, Numerical, NumIntegrate,
  1185. Off, On, Output,
  1186. pi, prod, PASICAL,
  1187. re, read, real, right,
  1188. sec, sech, show_all, sgn, sin, sinh, solve, sqrt, subs, sum, step,
  1189. system,
  1190. table, tan, tanh, to, TwoDim,
  1191. undefined,
  1192. zero,
  1193. +, -, *, /, ^, **, (), [], =, ==, >, >=, <, <=, <>, !, #, ,
  1194. -----------------------------------------------------------------------
  1195.  
  1196.  
  1197.              20.2 A list of keywords in functional order
  1198.  
  1199. ---------------------------------------------------------------------
  1200. 1. Built-in constants: i, e, pi, inf, zero, constant, discont,
  1201.         undefined.
  1202. 2. Built-in variables: last.
  1203. 3. Negative and positive: -, +.
  1204. 4. Algebraic operators: +, -, *, /, ^, **, (), =, ==.
  1205. 5. Logic operators: ==, >, >=, <, <=, <>.
  1206. 6. Algebraic functions: -x, sqrt(x), sgn(x), abs(x), n!, fac(n).
  1207. 7. Exponential functions: exp(x), ln(x), erf(x).
  1208. 8. Trigonometric functions: sin(x), cos(x), tan(x), csc(x), sec(x),
  1209.     cot(x), asin(x), acos(x), atan(x), acot(x), asec(x), acsc(x).
  1210. 9. Hyperbolic functions: sinh(x), cosh(x), tanh(x), csch(x), sech(x),
  1211.         coth(x), asinh(x), acosh(x), atanh(x), acoth(x), acsch(x),
  1212.         asech(x).
  1213. 10. User-defined functions: define(f(x)=x^2).
  1214. 11. Calculus functions: d((y)/d(x)), inte((y)*d(x)), subs(x=a to y), 
  1215.         lim(x=a, y), sum(), prod().
  1216. 12. Transformation functions: list(), expand(), factor(), solve(),
  1217.         table(), coef(), left(), right(), nume(), deno(), re(), im().
  1218. 13. List: [a, b].
  1219. 14. Element of list: f[1], last[1].
  1220. 15. Switches: =, Numerical, NumIntegrate, Output, On, Off, BASIC,
  1221.         FORTRAN, TwoDim, ExpExpand, LnExpand.
  1222. 16. Commands: system(), clear(), clear_all, show_all.
  1223. 17. Separators: "," , from, to, step.
  1224. 18. Assume: assume(a>0), assume(b==real).
  1225. 19. Define: define(f(x)=x^2).
  1226. 20. Comment: #.
  1227. 21. Action: defined, done, cleared, assumed.
  1228. --------------------------------------------------------------------
  1229.  
  1230.  
  1231.                 20.3 Keywords Dictionary
  1232.  
  1233. --------------------------------------------------------------------
  1234. abs(x)        
  1235. The absolute value function of x. e.g. abs(-1) gives 1.
  1236.  
  1237. acos(x)
  1238. The arc cosine function of x, the inverse function of cos(x).
  1239. The result is in radians.
  1240.  
  1241. acosh(x)
  1242. The arc hyerbolic cosine function of x, the inverse function of
  1243. cosh(x).
  1244.  
  1245. acot(x)
  1246. The arc cot function of x, the inverse function of cot(x).
  1247. The result is in radians.
  1248.  
  1249. acoth(x)
  1250. The arc coth function of x, the inverse function of coth(x).
  1251.  
  1252. acsc(x)
  1253. The arc csc function of x, the inverse function of csc(x).
  1254. The result is in radians.
  1255.  
  1256. acsch(x)
  1257. The arc csch function of x, the inverse function of csch(x).
  1258.  
  1259. asec(x)
  1260. The arc sec function of x, the inverse function of sec(x).
  1261. The result is in radians.
  1262.  
  1263. asech(x)
  1264. The arc sech function of x, the inverse function of sech(x).
  1265.  
  1266. asin(x)
  1267. The arc sine function of x, the inverse function of sin(x).
  1268. The result is in radians.
  1269.  
  1270. asinh(x)
  1271. The arc sinh function of x, the inverse function of sinh(x).
  1272.  
  1273. assume()
  1274. Assume a variable x to be positive, negative or real. All variables
  1275. are assumed as complex by default.
  1276. e.g. assume(x>0), assume(x<0), or assume(x == real).
  1277.  
  1278. assumed
  1279. It points out that the variable has been assumed.
  1280.  
  1281. atan(x)
  1282. The arc tan function of x, the inverse function of tan(x).
  1283. The result is in radians.
  1284.  
  1285. atanh(x)
  1286. The arc tanh function of x, the inverse function of tanh(x).
  1287.  
  1288. BASIC
  1289. Output in BASIC format. e.g. Output=BASIC.
  1290.  
  1291. clear()
  1292. Clear a variable, function or expression from memory. e.g. clear(p),
  1293. clear(f(x)).
  1294.  
  1295. clear_all
  1296. Clear all from memory.
  1297.  
  1298. cleared
  1299. It says that the variable, function or expression has been cleared
  1300. from memory.
  1301.  
  1302. coef(poly, x^n)
  1303. The coefficient function of x^n. It gives the coefficient of x^n in
  1304. the polynomial. e.g. coef(2*x^6+x+4, x^6) gives 2.
  1305.  
  1306. constant
  1307. The indefinite integral constant.
  1308.  
  1309. cos(x)
  1310. The cosine function of x. The angle x is measured in radians.
  1311.  
  1312. cosh(x)
  1313. The hyerbolic cosine function of x.
  1314.  
  1315. cot(x)
  1316. The cotan function of x. The angle x is measured in radians.
  1317.  
  1318. coth(x)
  1319. The hyerbolic cosine function of x, i.e. (exp(x)+exp(-x))/2.
  1320.  
  1321. csc(x)
  1322. The angle x is measured in radians.
  1323.  
  1324. csch(x)
  1325.  
  1326.  
  1327. d()
  1328. The derivative function.
  1329. d(f(x), x=c)     gives the derivative of f(x) with respect to an
  1330.                  undefined variable x at x=c.
  1331. d(f(x), x=c, n)  gives the n-th order derivative of f(x) with respect
  1332.                  to an undefined variable x at x=c.
  1333. d(f(x)/d(x))     differentiate y with respect to x.
  1334.                  e.g. d(x^2/d(x)) gives 2*x.
  1335. d(f(x)/d(x), n)  gives the n-th order derivative of f(x) with respect
  1336.                  to an undefined variable x.
  1337. d(y)             implicit differentiation, used in differential
  1338.                  equations, e.g. x*d(x)+y*d(y) == 0.
  1339.  
  1340. define()
  1341. Define an user function. e.g. define(f(x)=x^2).
  1342.  
  1343. defined
  1344. It indicates that the user function has been defined.
  1345.  
  1346. deno()
  1347. It gives the denominator of expr. e.g. deno(a/b) gives b.
  1348.  
  1349. discont
  1350. The discontinuity. If the function value is discont, the function has
  1351. a discontinuity and only has the one-sided limit at x=c. Users should
  1352. evaluate its left-sided limit or right-sided limit by x=c-zero or 
  1353. x=c+zero.
  1354.  
  1355. done
  1356. It indicates that the action has been done.
  1357.  
  1358. system(system command)
  1359. execute operating system (DOS) command. e.g. system(dir).
  1360.  
  1361. E
  1362. The exponential part of a floating point number. e.g. 1.1E2.
  1363.  
  1364. e
  1365. (1) 2.718..., the built-in constant, e is converted to 2.718... when the
  1366. switch Numerical=On.
  1367. (2) The exponential part of a floating point number, the same as E.
  1368. e.g. 1.1e2.
  1369.  
  1370. erf(x)
  1371. The error function of x, or the probability integral function.
  1372.  
  1373. exp(x)
  1374. The exponential function of x based of e. The same as e^x, e=2.718...
  1375. It is the inverse to ln(x).
  1376.  
  1377. ExpExpand
  1378. The switch of exponential expansion.
  1379. ExpExpand=On       e.g. c^(a+b) to c^a*c^b.
  1380. ExpExpand=Off      disable exponential expansion, this is default.
  1381.  
  1382. expand(expr)
  1383. The expansion function. The expand(expr) is to expand expr, e.g.
  1384. expand((a+b)^2) gives a^2 + 2*a*b + b^2.
  1385.  
  1386. fac(n)
  1387. The factorial of n. The same as n!. e.g. fac(3) gives 6.
  1388.  
  1389. factor(expr)
  1390. The factorisation function. The factor(expr) is to factorise from
  1391. expr, e.g. factor(a^2 + 2*a*b + b^2) gives (a+b)^2.
  1392.  
  1393. FORTRAN
  1394. Output in FORTRAN format. e.g. Output=FORTRAN.
  1395.  
  1396. from
  1397. The separator, the same as the comma (,).
  1398.  
  1399. i
  1400. The imaginative sign of the complex number. e.g. 1+2*i.
  1401.  
  1402. im(x)
  1403. The imaginative part of complex numbers. e.g. im(1+2*i) gives 2.
  1404.  
  1405. inf
  1406. The positive infinity, as the built-in constant.
  1407.  
  1408. inte()
  1409. The integral function.
  1410. inte(f(x),x,a,b)   find the definite integral of f(x) with respect to
  1411.                    an undefined variable x taken from x=a to x=b.
  1412. inte(f(x), x from a to b)          the same as inte(f(x),x,a,b).
  1413. inte(f(x)*d(x))    find the indefinite integral of f(x) with respect
  1414.                    to an undefined variable x.
  1415. inte(y)            implicit integration, used to integrate the
  1416.                    differential equations.
  1417.  
  1418.  
  1419. last
  1420. The last output, as the built-in variable.
  1421. last[1]         the first element of the last output list.
  1422.  
  1423. left(equation)
  1424. It gives the left hand side of an equation. e.g. left(x+y==2)
  1425. gives x+y.
  1426.  
  1427. lim()
  1428. The limit function.
  1429. lim(x=c, expr)          gives the limit of expr when x approaches c.
  1430. lim(x=c to expr)        the same as lim(x=c, expr).
  1431. e.g. lim(x=0, sin(x)/x) gives 1.
  1432. Note that the correct answers only for the indeterminate forms:
  1433. 0/0, inf/inf, 0*inf, 0^0, inf^0.
  1434.  
  1435. list()
  1436. The list function.
  1437. list(f(x), x from a to b step c)    lists of f(x),
  1438.                                     e.g. list(x^2, x from 1 to 3 step 1)
  1439.                                     gives [1,4,9].
  1440. list(a+b)      transform sum to list, e.g. list(a+b) gives [a,b].
  1441.  
  1442. ln(x)
  1443. The natural logarithmic function of x. Its base is e. It is the
  1444. inverse to exp(x). Warming that if it has multi-values, the ln(x) 
  1445. only gives a principle value (P.V.) and other values are 
  1446. P.V.+2*k*pi*i (where k=0, 1, 2,..., -1, -2, ...).
  1447.  
  1448. LnExpand
  1449. The switch of the logarithmic expansion.
  1450. LnExpand=On       log expansion, e.g. ln(a*b) is expanded into
  1451.                   ln(a)+ln(b).
  1452. LnExpand=Off      disable log expansion, this is default.
  1453.  
  1454. n!              
  1455. The factorial of n. The same as fac(n). e.g. 3! gives 6.
  1456.  
  1457. nume()
  1458. It gives the numerator of expr. e.g. nume(a/b) gives a.
  1459.  
  1460. Numerical
  1461. The switch of numerical calculation.
  1462. Numerical=On       numerical computation.
  1463. Numerical=Off      disable numerical computation, this is default.
  1464.  
  1465. NumIntegrate
  1466. The switch of numeric integration.
  1467. NumIntegrate=On         numeric integration.
  1468. NumIntegrate=Off        disable numeric integration, this is default.
  1469.  
  1470. Off
  1471. When the switch is set to Off, it is inactive. e.g. Numerical=Off,
  1472. Output=Off, NumIntegrate=Off, Expand=Off.
  1473.  
  1474. On
  1475. When the switch is set to On, it is active. e.g. Numerical=On,
  1476. NumIntegrate=On, Expand=On, ExpExpand=On, LnExpand=On.
  1477.  
  1478. Output
  1479. The switch of the output format, e.g. Output=BASIC, Output=FORTRAN,
  1480. Output=PASCAL, Output=TwoDim, or Output=Off.
  1481.  
  1482. to
  1483. The separator, the same as the comma (,).
  1484.  
  1485. pi
  1486. 3.1416..., as the built-in constant, pi is converted to 3.1416... when
  1487. the switch Numerical=On.
  1488.  
  1489. prod()
  1490. The product function.
  1491. prod(f(x), x from a to b step c)            product of f(x).
  1492. prod(f(x), x from a to b)                   product of f(x) as step=1.
  1493.  
  1494. re(x)
  1495. The real part of complex numbers. e.g. re(1+2*i) gives 1.
  1496.  
  1497. real
  1498. Assume a variable x to be real. e.g. assume(x == real).
  1499.  
  1500. right(equation)
  1501. It gives the right hand side of an equation. e.g. right(x+y==3)
  1502. gives 3.
  1503.  
  1504. sec(x)
  1505. The angle x is measured in radians.
  1506.  
  1507. sech(x)
  1508.  
  1509. show_all
  1510. Show all in memory.
  1511.  
  1512. sgn(x)
  1513. The sign function of x. It is 1 when Re(x) > 0, or Re(x) = 0 and 
  1514. Im(x) > 0; 0 when x=0; -1 otherwise.
  1515.  
  1516. sin(x)
  1517. The sine function of x. The angle x is measured in radians.
  1518.  
  1519. sinh(x)
  1520. The hyerbolic sine function of x, i.e. (exp(x)-exp(-x))/2.
  1521.  
  1522. solve(equation, unknown)
  1523. Solve a polynomial, systems of linear equations, linear differential 
  1524. equations. e.g. solve(x^2+5*x+6==0, x), solve([x+y==3,x-y==1], [x,y]), 
  1525. solve(d(y)/d(x)+x*y==2, y).
  1526.  
  1527. sqrt(x)
  1528. The square root function of x. It is the same as x^0.5.
  1529.  
  1530. subs(x=c to expr)
  1531. Substitutes x by c in expr. subs(x=c, expr) is the same
  1532. as subs(x=c to expr). e.g. subs(x=a to x^2) gives a^2.
  1533.  
  1534. sum()
  1535. The sum function.
  1536. sum(f(x), x from a to b step c)         sum of f(x), e.g.
  1537.                                         sum(2^n, n from 1 to 10 step 1.2).
  1538. sum(f(x), x from a to b)                sum of f(x) as step=1, e.g.
  1539.                                         sum(2^n, n from 1 to 10).
  1540. sum([a,b])              transform list to sum, e.g. sum([a,b]) gives a+b.
  1541.  
  1542. step
  1543. The separator, the same as the comma (,).
  1544.  
  1545. table()
  1546. Produce a table of the function values.
  1547. table(f(x), x from a to b step c)       data table.
  1548. e.g. table(x^2, x from 1 to 20 step 2).
  1549.  
  1550. tan(x)
  1551. The angle x is measured in radians.
  1552.  
  1553. tanh(x)
  1554.  
  1555. TwoDim
  1556. Output in two dimension format. e.g. Output=TwoDim.
  1557.  
  1558. undefined
  1559. The built-in constant. It indicates that the value of the expression 
  1560. is undefined. e.g. the indeterminate forms: 0/0, inf/inf, 0*inf, 0^0. 
  1561. Users should try again by lim(x=c, f(x)).
  1562.  
  1563. zero
  1564. The right-hand sided value at x=0, as the built-in constant. -zero
  1565. is the left-sided limit from the negative direction. e.g. 1+zero is 
  1566. to approach to 1 from the positive (+infinity) direction (the right-
  1567. hand sided value), and 1-zero is to approach to 1 from the negative
  1568. (-infinity) direction (the left-hand sided value), i.e. limit as
  1569. zero -> 0. e.g. exp(1/(0+zero)) gives inf, exp(1/(0-zero)) gives 0.
  1570.  
  1571.  
  1572. +       add or positive sign.
  1573. -       subtract or negative sign.
  1574. *       multiply.
  1575. /       divide.
  1576. ^       power in BASIC, the same as ** in FORTRAN, e.g. 2^3 gives 8.
  1577. **      power in FORTRAN, the same as ^ in BASIC.
  1578. !       factorial, the same as fac(x), e.g. 3! or fac(3) gives 6.
  1579. <       less than.
  1580. <=      less than.
  1581. >       greater than.
  1582. >=      greater than.
  1583. <>      unequals.
  1584. ==      equals, or equation sign.
  1585. =       assignment.
  1586. ,       separator.
  1587. #       comment statement.
  1588. -------------------------------------------------------------------------
  1589.  
  1590.  
  1591.             21. References
  1592.  
  1593. [1] Buchberger, B., Collins, G.E., and Loos, R., Computer Algebra,
  1594.     Springer-Verlag, New York, 1983, pp. 4-7.
  1595. [2] Oman, P., IEEE Software, 1990, Vol. 7, pp. 93-95, pp. 98.
  1596. [3] Calmet, J., Int. J. Math. Educ. Sci. Technol., 1987, 18(5), 663-680.
  1597. [4] Raeth, P.G., Expert Systems: A Software Methodology for Modern 
  1598.     Applications, IEEE Computer Society Press,  Washington, 1990, pp. 
  1599.     17-51.
  1600. [5] Huang, W., Proceedings of the Workshop on Symbolic and Numeric
  1601.     Computation, Helsinki Uni., Finland, 1991, pp. 185-186.
  1602. [6] Huang, W., Int. J. Math. Educ. Sci. Technol., 1992, in press.
  1603. [7] Huang, W., Abs. Am. Math. Soc., 1992, 13(3), 343.
  1604. [8] Huang, W., Proceeding of 7th Inter. Congress on Math. Educ., Uni.
  1605.     Laval, Canada, 1992, in press.
  1606.